from random import choices, choice

# 号码前缀
PREFIX = [
    '130', '131', '132', '133', '134', '135', '136', '137', '138', '139',
    '145', '147', '149', '150', '151', '152', '153', '155', '156', '157',
    '158', '159', '165', '171', '172', '173', '174', '175', '176', '177',
    '178', '180', '181', '182', '183', '184', '185', '186', '187', '188',
    '189', '191'
]


def builder(prefix=None):
    if prefix is None:
        prefix = choice(PREFIX)
    return '{}{}'.format(prefix, ''.join(choices('0123456789', k=8)))


if __name__ == '__main__':
    # 不传前缀则随机生成号码
    print(builder())
    print('-' * 20)

    # 打印各个号段手机号码
    for prefix in PREFIX:
        print(builder(prefix))
